package com.tt.plat8.userbase.service.impl;


import com.tt.plat8.userbase.service.UserService;

import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * UserBean: tangtao
 * Date: 14-1-15
 * Time: 下午4:37
 * To change this template use File | Settings | File Templates.
 */
public class UserServiceImpl implements UserService{

    private EntityManager em;

    public void setEntityManager(EntityManager em) {
        this.em = em;

        System.out.println("------------------------------emf=="+em);
    }
    @Override
    public void showUser() {
       System.out.println("show user");

        Query query = em.createQuery("select u from USERTABLE u");

        List list = query.getResultList();

        System.out.println("list="+list);
    }
}
